import { http } from '@/utils/http/axios';
import axios from 'axios';

/**
 * @description: 获取设备列表展示数据
 */
export function getTableList(params) {
  console.log('getTableListparams', params);
  return http.request({
    url: '/equipment/equipment_list',
    method: 'get',
    params: params,
  });
}

/**
 * @description: 获取项目信息下拉框数据(可以共用一个路由不修改)
 */
export function getProjcetOptions(params) {
  console.log('getProjcetOptionsparams', params);
  return http.request({
    url: '/project/projectOptions',
    method: 'GET',
    params: params,
  });
}

/**
 * @description: 获取设备组下拉框信息数据
 */
export function getGroupOptions(params) {
  console.log('getGroupOptionsparams', params);
  return http.request({
    url: '/equipment/groupOptions',
    method: 'GET',
    params: params,
  });
}

/**
 * @description: 批量删除选中的数据
 */
export function batchDelEquipment(params) {
  console.log('batchdel param:', params);
  return http.request({
    url: '/equipment/del_equipment',
    method: 'POST',
    data: params,
  });
}

/**
 * @description: 创建新设备
 */
export function createEquipment(params) {
  return http.request({
    url: '/equipment/add_equipment',
    method: 'POST',
    params,
  });
}

/**
 * @description: edit初始化
 */
export function getEditInit(params) {
  return http.request({
    url: '/equipment/init_equipment',
    method: 'GET',
    params: params,
  });
}

/**
 * @description: 更新设备
 */
export function updateEquipment(params) {
  return http.request({
    url: '/equipment/update_equipment',
    method: 'POST',
    params,
  });
}

/**
 * @description: 获取人员列表数据
 */
export function getRlsEmpList(params) {
  return http.request({
    url: '/equipment/employee_list',
    method: 'get',
    params: params,
  });
}

/**
 * @description: 下发至设备
 */
export function sendToEquip(params) {
  return http.request({
    url: '/equipment/sendtoequip',
    method: 'post',
    params: params,
  });
}

/**
 * @description: 获取已下发人员列表数据
 */
export function getRlsedEmpList(params) {
  return http.request({
    url: '/equipment/releasedemployee_list',
    method: 'get',
    params: params,
  });
}

/**
 * @description: 删除已下发人员信息
 */
export function deleteEmpEquip(params) {
  return http.request({
    url: '/equipment/deleteempequip',
    method: 'post',
    params: params,
  });
}
